package com.htfyun.factorytest.common;

import com.htfyun.factorytest.utils.FileReadWrite;

public class LedCtrl_PX30 {
    /**
     * r red on
     * R red off
     *
     * g green on
     * G green off
     *
     * b blue on
     * B blue off
     *
     * x unControl
     */
    private static final String LEDS_PATH = "/sys/bus/platform/devices/rk817-battery/bat";

    public static void setLed(String value) {
        FileReadWrite.writeStringToFile(LEDS_PATH, value);
    }

    public static void unControlLed() {
        FileReadWrite.writeStringToFile(LEDS_PATH, "x");
    }

    public static void enableRed() {
        FileReadWrite.writeStringToFile(LEDS_PATH, "r");
        FileReadWrite.writeStringToFile(LEDS_PATH, "G");
        FileReadWrite.writeStringToFile(LEDS_PATH, "B");
    }

    public static void enableGreen() {
        FileReadWrite.writeStringToFile(LEDS_PATH, "R");
        FileReadWrite.writeStringToFile(LEDS_PATH, "g");
        FileReadWrite.writeStringToFile(LEDS_PATH, "B");
    }

    public static void enableBlue() {
        FileReadWrite.writeStringToFile(LEDS_PATH, "R");
        FileReadWrite.writeStringToFile(LEDS_PATH, "G");
        FileReadWrite.writeStringToFile(LEDS_PATH, "b");
    }

}
